import 'dart:convert';

import 'package:flutter_module/beans/base_bean.dart';

class SelectionBean extends BaseBean {
  String name;
  String value;

  SelectionBean(this.name, this.value);

  @override
  Map<String, dynamic> toMap() {
    return {'name': name, 'value': value};
  }

  String toJson() {
    return '{"name": "$name", "value": "$value"}';
  }

  factory SelectionBean.from(Map map) {
    return SelectionBean(map['name'], map["value"]);
  }

  factory SelectionBean.fromJson(String json) {
    var map = jsonDecode(json);
    return SelectionBean(map['name'], map["value"]);
  }
}
